#include "Weather.h"

Weather::Weather(){
}
Weather::~Weather(){
}

void Weather::rainy(Farm& farm){
    for (int i = 0 ; i<= FARM_HEIGHT-1; i++){
        for (int j=0; j<=FARM_WIDTH-1; j++){
            Point p;
            p.x = i;
            p.y = j;
            if (farm.isPlowed(p))
                farm.setWatered(p);
        }
    }
}

void Weather::storm(Farm& farm){
    for (int i = 0 ; i<= FARM_HEIGHT-1; i++){
        for (int j=0; j<=FARM_WIDTH-1; j++){
            Point p;
            p.x = i;
            p.y = j;
            if ((i % 2 == 0) && (farm.getFarmPlan()[i][j].plant!=NULL)){
                farm.setSlashed(p);
            }
        }
    }
}
